var chalk = require('chalk');
const pluginName = 'FailedPlugin';

class FailedPlugin {
    apply(compiler) {
        //编译失败时处理
        compiler.hooks.failed.tap(
            pluginName,
            (error) => {
                console.log(chalk.red(`执行--->${pluginName}`));
                console.log(chalk.red(`错误--->${error}`));
            }
        );
    }
}

module.exports = FailedPlugin;